package top.yaofengqiao.springcloudsimple.system.biz.domain.dict.service;

import org.springframework.stereotype.Service;
import top.yaofengqiao.springcloudsimple.common.util.PageInfo;
import top.yaofengqiao.springcloudsimple.common.util.PageParam;
import top.yaofengqiao.springcloudsimple.system.biz.domain.dict.entity.DictEntity;
import top.yaofengqiao.springcloudsimple.system.biz.domain.dict.repository.IDictRepository;

import javax.annotation.Resource;

/**
 * @author yfq
 * @date 14:19
 * @description
 */
@Service
public class DictService implements IDictService {
    @Resource
    private IDictRepository dictRepository;

    @Override
    public PageInfo<DictEntity> queryDictTypes(DictEntity dictEntity, PageParam pageParam) {
        return dictRepository.queryDictTypes(dictEntity, pageParam);
    }

    @Override
    public DictEntity queryDictEntityById(long id) {
        return dictRepository.queryDictEntityById(id);
    }

    @Override
    public DictEntity queryDictEntityByType(String type) {
        return dictRepository.queryDictEntityByType(type);
    }

    @Override
    public boolean updateDictType(DictEntity dictEntity) {
        return dictRepository.updateDictType(dictEntity);
    }

    @Override
    public boolean updateDictData(DictEntity.Value value) {
        return dictRepository.updateDictData(value);
    }

    @Override
    public boolean saveDictType(DictEntity dictEntity) {
        return dictRepository.saveDictType(dictEntity);
    }

    @Override
    public boolean saveDictData(DictEntity.Value value) {
        return dictRepository.saveDictData(value);
    }

}
